{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [],
   "source": [
    "uen=200;"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {},
   "outputs": [],
   "source": [
    "bsloc=[[-12.994,-4.752],[12.915,-24.941]]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {
    "scrolled": true
   },
   "outputs": [],
   "source": [
    "import numpy as np"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 50,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "tdelay=pd.read_csv('tdelay.csv')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 51,
   "metadata": {},
   "outputs": [],
   "source": [
    "import matplotlib.pyplot as plt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "metadata": {},
   "outputs": [],
   "source": [
    "c=3*10e8"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "metadata": {},
   "outputs": [],
   "source": [
    "t=tdelay*10e-9"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 54,
   "metadata": {},
   "outputs": [],
   "source": [
    "r=tdelay*0.3"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 56,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>bs1</th>\n",
       "      <th>bs2</th>\n",
       "      <th>bs3</th>\n",
       "      <th>bs4</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>40.2783</td>\n",
       "      <td>71.9304</td>\n",
       "      <td>29.1597</td>\n",
       "      <td>54.6180</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>74.2308</td>\n",
       "      <td>83.9184</td>\n",
       "      <td>90.7815</td>\n",
       "      <td>49.6182</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>101.4561</td>\n",
       "      <td>130.8990</td>\n",
       "      <td>76.3530</td>\n",
       "      <td>102.0135</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>52.2387</td>\n",
       "      <td>63.3477</td>\n",
       "      <td>86.1006</td>\n",
       "      <td>52.1301</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>64.6587</td>\n",
       "      <td>77.0607</td>\n",
       "      <td>94.1763</td>\n",
       "      <td>49.0998</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>53.5401</td>\n",
       "      <td>71.3616</td>\n",
       "      <td>57.3249</td>\n",
       "      <td>83.3007</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>72.4755</td>\n",
       "      <td>65.5779</td>\n",
       "      <td>92.6124</td>\n",
       "      <td>52.0002</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>108.0384</td>\n",
       "      <td>92.5191</td>\n",
       "      <td>130.5825</td>\n",
       "      <td>80.9535</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>98.8263</td>\n",
       "      <td>112.1931</td>\n",
       "      <td>100.5327</td>\n",
       "      <td>78.8331</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>82.8735</td>\n",
       "      <td>88.8627</td>\n",
       "      <td>87.4455</td>\n",
       "      <td>99.7911</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>76.4940</td>\n",
       "      <td>109.7967</td>\n",
       "      <td>51.7668</td>\n",
       "      <td>92.5941</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>50.8929</td>\n",
       "      <td>55.6719</td>\n",
       "      <td>68.7102</td>\n",
       "      <td>28.9671</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>67.1211</td>\n",
       "      <td>73.5750</td>\n",
       "      <td>74.3796</td>\n",
       "      <td>51.1296</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>51.7446</td>\n",
       "      <td>15.2811</td>\n",
       "      <td>75.7128</td>\n",
       "      <td>48.5157</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>80.4633</td>\n",
       "      <td>45.4170</td>\n",
       "      <td>104.5413</td>\n",
       "      <td>75.0258</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>53.0622</td>\n",
       "      <td>76.0326</td>\n",
       "      <td>32.0241</td>\n",
       "      <td>63.7215</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>67.5846</td>\n",
       "      <td>34.6239</td>\n",
       "      <td>95.4525</td>\n",
       "      <td>65.0190</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>52.9617</td>\n",
       "      <td>80.2272</td>\n",
       "      <td>52.8033</td>\n",
       "      <td>40.5024</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>66.2088</td>\n",
       "      <td>61.8267</td>\n",
       "      <td>79.0245</td>\n",
       "      <td>43.1733</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>41.4834</td>\n",
       "      <td>23.6073</td>\n",
       "      <td>71.0400</td>\n",
       "      <td>31.3365</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>33.7140</td>\n",
       "      <td>42.8766</td>\n",
       "      <td>42.9627</td>\n",
       "      <td>59.2092</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>55.4448</td>\n",
       "      <td>79.6419</td>\n",
       "      <td>59.8281</td>\n",
       "      <td>74.6283</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>80.8911</td>\n",
       "      <td>52.0461</td>\n",
       "      <td>101.6508</td>\n",
       "      <td>69.6678</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>81.4461</td>\n",
       "      <td>107.0550</td>\n",
       "      <td>59.4450</td>\n",
       "      <td>90.8430</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>80.5767</td>\n",
       "      <td>91.5501</td>\n",
       "      <td>82.5924</td>\n",
       "      <td>49.9023</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>67.2690</td>\n",
       "      <td>99.9108</td>\n",
       "      <td>46.9464</td>\n",
       "      <td>96.0051</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>57.8838</td>\n",
       "      <td>72.9033</td>\n",
       "      <td>83.9580</td>\n",
       "      <td>43.5273</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>50.9187</td>\n",
       "      <td>66.0261</td>\n",
       "      <td>72.0195</td>\n",
       "      <td>77.9025</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>61.2822</td>\n",
       "      <td>83.8245</td>\n",
       "      <td>70.8483</td>\n",
       "      <td>45.6171</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>118.2897</td>\n",
       "      <td>86.0295</td>\n",
       "      <td>151.3332</td>\n",
       "      <td>120.6513</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>170</th>\n",
       "      <td>27.8328</td>\n",
       "      <td>60.8478</td>\n",
       "      <td>21.7509</td>\n",
       "      <td>47.8809</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>171</th>\n",
       "      <td>92.4060</td>\n",
       "      <td>114.4818</td>\n",
       "      <td>97.4520</td>\n",
       "      <td>77.2605</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>172</th>\n",
       "      <td>100.3713</td>\n",
       "      <td>133.7574</td>\n",
       "      <td>80.6844</td>\n",
       "      <td>103.6614</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>173</th>\n",
       "      <td>56.2593</td>\n",
       "      <td>40.0407</td>\n",
       "      <td>76.6365</td>\n",
       "      <td>41.8236</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>174</th>\n",
       "      <td>74.0742</td>\n",
       "      <td>46.7907</td>\n",
       "      <td>103.2534</td>\n",
       "      <td>66.6132</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>175</th>\n",
       "      <td>92.5383</td>\n",
       "      <td>108.9513</td>\n",
       "      <td>90.4632</td>\n",
       "      <td>67.4643</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>176</th>\n",
       "      <td>60.4824</td>\n",
       "      <td>93.3393</td>\n",
       "      <td>83.6508</td>\n",
       "      <td>72.2112</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>177</th>\n",
       "      <td>75.0300</td>\n",
       "      <td>75.2556</td>\n",
       "      <td>100.0353</td>\n",
       "      <td>61.2381</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>178</th>\n",
       "      <td>70.5174</td>\n",
       "      <td>49.2324</td>\n",
       "      <td>100.2579</td>\n",
       "      <td>68.3328</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>179</th>\n",
       "      <td>106.2393</td>\n",
       "      <td>78.0150</td>\n",
       "      <td>125.0691</td>\n",
       "      <td>114.4092</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>180</th>\n",
       "      <td>91.9488</td>\n",
       "      <td>125.3718</td>\n",
       "      <td>72.2736</td>\n",
       "      <td>100.5321</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>181</th>\n",
       "      <td>92.8872</td>\n",
       "      <td>55.0059</td>\n",
       "      <td>120.1323</td>\n",
       "      <td>102.2637</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>182</th>\n",
       "      <td>87.5631</td>\n",
       "      <td>111.1779</td>\n",
       "      <td>71.3871</td>\n",
       "      <td>113.0829</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>183</th>\n",
       "      <td>82.8465</td>\n",
       "      <td>97.1850</td>\n",
       "      <td>96.3636</td>\n",
       "      <td>57.4182</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>184</th>\n",
       "      <td>109.6254</td>\n",
       "      <td>68.6322</td>\n",
       "      <td>128.5551</td>\n",
       "      <td>97.5924</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>185</th>\n",
       "      <td>102.2040</td>\n",
       "      <td>72.8304</td>\n",
       "      <td>130.9719</td>\n",
       "      <td>106.7946</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>186</th>\n",
       "      <td>96.8352</td>\n",
       "      <td>73.2861</td>\n",
       "      <td>125.4078</td>\n",
       "      <td>91.5381</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>187</th>\n",
       "      <td>70.9644</td>\n",
       "      <td>47.2293</td>\n",
       "      <td>105.2472</td>\n",
       "      <td>71.6487</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>188</th>\n",
       "      <td>34.5225</td>\n",
       "      <td>58.8336</td>\n",
       "      <td>39.9378</td>\n",
       "      <td>20.1636</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>189</th>\n",
       "      <td>81.5169</td>\n",
       "      <td>77.7510</td>\n",
       "      <td>87.0885</td>\n",
       "      <td>95.5269</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>190</th>\n",
       "      <td>50.5287</td>\n",
       "      <td>74.9856</td>\n",
       "      <td>64.8618</td>\n",
       "      <td>43.5528</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>191</th>\n",
       "      <td>99.4788</td>\n",
       "      <td>127.2603</td>\n",
       "      <td>90.5712</td>\n",
       "      <td>92.1390</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>192</th>\n",
       "      <td>54.9219</td>\n",
       "      <td>51.3384</td>\n",
       "      <td>76.2267</td>\n",
       "      <td>74.9640</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>193</th>\n",
       "      <td>29.8356</td>\n",
       "      <td>60.7230</td>\n",
       "      <td>32.7906</td>\n",
       "      <td>31.5129</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>194</th>\n",
       "      <td>38.4924</td>\n",
       "      <td>63.2463</td>\n",
       "      <td>10.9479</td>\n",
       "      <td>48.0246</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>195</th>\n",
       "      <td>88.3302</td>\n",
       "      <td>68.2947</td>\n",
       "      <td>114.7290</td>\n",
       "      <td>99.8637</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>196</th>\n",
       "      <td>84.0897</td>\n",
       "      <td>72.4410</td>\n",
       "      <td>99.6822</td>\n",
       "      <td>60.2511</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>197</th>\n",
       "      <td>63.1272</td>\n",
       "      <td>43.0575</td>\n",
       "      <td>97.3479</td>\n",
       "      <td>51.3828</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>198</th>\n",
       "      <td>58.2654</td>\n",
       "      <td>35.4624</td>\n",
       "      <td>87.5445</td>\n",
       "      <td>57.2436</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>199</th>\n",
       "      <td>27.1833</td>\n",
       "      <td>30.5127</td>\n",
       "      <td>55.2936</td>\n",
       "      <td>21.6315</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>200 rows × 4 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "          bs1       bs2       bs3       bs4\n",
       "0     40.2783   71.9304   29.1597   54.6180\n",
       "1     74.2308   83.9184   90.7815   49.6182\n",
       "2    101.4561  130.8990   76.3530  102.0135\n",
       "3     52.2387   63.3477   86.1006   52.1301\n",
       "4     64.6587   77.0607   94.1763   49.0998\n",
       "5     53.5401   71.3616   57.3249   83.3007\n",
       "6     72.4755   65.5779   92.6124   52.0002\n",
       "7    108.0384   92.5191  130.5825   80.9535\n",
       "8     98.8263  112.1931  100.5327   78.8331\n",
       "9     82.8735   88.8627   87.4455   99.7911\n",
       "10    76.4940  109.7967   51.7668   92.5941\n",
       "11    50.8929   55.6719   68.7102   28.9671\n",
       "12    67.1211   73.5750   74.3796   51.1296\n",
       "13    51.7446   15.2811   75.7128   48.5157\n",
       "14    80.4633   45.4170  104.5413   75.0258\n",
       "15    53.0622   76.0326   32.0241   63.7215\n",
       "16    67.5846   34.6239   95.4525   65.0190\n",
       "17    52.9617   80.2272   52.8033   40.5024\n",
       "18    66.2088   61.8267   79.0245   43.1733\n",
       "19    41.4834   23.6073   71.0400   31.3365\n",
       "20    33.7140   42.8766   42.9627   59.2092\n",
       "21    55.4448   79.6419   59.8281   74.6283\n",
       "22    80.8911   52.0461  101.6508   69.6678\n",
       "23    81.4461  107.0550   59.4450   90.8430\n",
       "24    80.5767   91.5501   82.5924   49.9023\n",
       "25    67.2690   99.9108   46.9464   96.0051\n",
       "26    57.8838   72.9033   83.9580   43.5273\n",
       "27    50.9187   66.0261   72.0195   77.9025\n",
       "28    61.2822   83.8245   70.8483   45.6171\n",
       "29   118.2897   86.0295  151.3332  120.6513\n",
       "..        ...       ...       ...       ...\n",
       "170   27.8328   60.8478   21.7509   47.8809\n",
       "171   92.4060  114.4818   97.4520   77.2605\n",
       "172  100.3713  133.7574   80.6844  103.6614\n",
       "173   56.2593   40.0407   76.6365   41.8236\n",
       "174   74.0742   46.7907  103.2534   66.6132\n",
       "175   92.5383  108.9513   90.4632   67.4643\n",
       "176   60.4824   93.3393   83.6508   72.2112\n",
       "177   75.0300   75.2556  100.0353   61.2381\n",
       "178   70.5174   49.2324  100.2579   68.3328\n",
       "179  106.2393   78.0150  125.0691  114.4092\n",
       "180   91.9488  125.3718   72.2736  100.5321\n",
       "181   92.8872   55.0059  120.1323  102.2637\n",
       "182   87.5631  111.1779   71.3871  113.0829\n",
       "183   82.8465   97.1850   96.3636   57.4182\n",
       "184  109.6254   68.6322  128.5551   97.5924\n",
       "185  102.2040   72.8304  130.9719  106.7946\n",
       "186   96.8352   73.2861  125.4078   91.5381\n",
       "187   70.9644   47.2293  105.2472   71.6487\n",
       "188   34.5225   58.8336   39.9378   20.1636\n",
       "189   81.5169   77.7510   87.0885   95.5269\n",
       "190   50.5287   74.9856   64.8618   43.5528\n",
       "191   99.4788  127.2603   90.5712   92.1390\n",
       "192   54.9219   51.3384   76.2267   74.9640\n",
       "193   29.8356   60.7230   32.7906   31.5129\n",
       "194   38.4924   63.2463   10.9479   48.0246\n",
       "195   88.3302   68.2947  114.7290   99.8637\n",
       "196   84.0897   72.4410   99.6822   60.2511\n",
       "197   63.1272   43.0575   97.3479   51.3828\n",
       "198   58.2654   35.4624   87.5445   57.2436\n",
       "199   27.1833   30.5127   55.2936   21.6315\n",
       "\n",
       "[200 rows x 4 columns]"
      ]
     },
     "execution_count": 56,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "r"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 73,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAARMAAAD8CAYAAABUzEBbAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAADtJJREFUeJzt3W2sZWV5xvH/1UFMOiUVZXiRF0vqBINNmerJWEPaiC8IxDrSYDt8sFRJxhpJatoPYk3U6Be1WpKK1YxKpI2C1had6AiM1ARNqjJDBgWBMlJaDjNhRBQ0WsnYux/2OnR72GfezvOcc/bx/0t29np51jr3zs5cs9Zea+87VYUkLdavLXcBklYHw0RSE4aJpCYME0lNGCaSmjBMJDXRJEySXJNkf5I7x5Y9M8mOJPcNz8cvsO1lw5j7klzWoh5JS6/VkckngQvmLbsSuKWq1gO3DPO/JMkzgXcCLwI2Au9cKHQkrWxNwqSqbgUenbd4E3DtMH0t8JoJm74S2FFVj1bVD4EdPDWUJE2BYzru+6Sq2gdQVfuSnDhhzKnAg2Pzs8Oyp0iyBdgCsHbt2hc+73nPa1yupDm7du16pKrWHck2PcPkcGTCson391fVVmArwMzMTO3cubNnXdKvtCT/daTb9Lya83CSUwCG5/0TxswCp4/Nnwbs7ViTpE56hsk2YO7qzGXAFyaMuQk4P8nxwwev5w/LJE2ZVpeGrwP+HTgryWySy4H3Aq9Ich/wimGeJDNJPg5QVY8C7wFuGx7vHpZJmjKZxp8g8DMTqa8ku6pq5ki28Q5YSU0YJpKaMEwkNWGYSGrCMJHUhGEiqQnDRFIThomkJgwTSU0YJpKaMEwkNWGYSGrCMJHUhGEiqQnDRFIThomkJgwT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NpD7sfb6SW1sBpOcyStAIaJpCYME0lNGCaSmjBMJDVhmEhqwjCR1MT/ARhgRPX1LIALAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "boxa = 10\n",
    "\n",
    "\n",
    "# 创建一个新的图形\n",
    "fig, ax = plt.subplots()\n",
    "# 设置坐标轴的范围\n",
    "ax.set_xlim(-boxa, boxa)\n",
    "ax.set_ylim(-boxa, boxa)\n",
    "# 设置坐标轴等比例显示\n",
    "ax.set_aspect('equal')\n",
    "\n",
    "for i in range(10):\n",
    "    # 创建一个圆形，中心位于(0, 0)，半径为5\n",
    "    circle = plt.Circle((bsloc[0]), r['bs1'][i], edgecolor='b', facecolor='none')\n",
    "    # 添加圆形到图形中\n",
    "    ax.add_artist(circle)\n",
    "    # 创建一个圆形，中心位于(0, 0)，半径为5\n",
    "    circle = plt.Circle((bsloc[1]), r['bs2'][i], edgecolor='b', facecolor='none')\n",
    "    # 添加圆形到图形中\n",
    "    ax.add_artist(circle)\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "# 显示图形\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 62,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[12.915, -24.941]"
      ]
     },
     "execution_count": 62,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "bsloc[1]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 89,
   "metadata": {},
   "outputs": [],
   "source": [
    "tdelay7=pd.read_csv('tdelay7.csv')\n",
    "tdelay7np = np.array(tdelay7)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 96,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[  6.572, -24.373,   0.798,   0.   ],\n",
       "       [-59.227, -13.774, -22.141,   0.   ],\n",
       "       [ -7.937,  16.387, -28.543,   0.   ],\n",
       "       [ -5.107,  -7.793, -22.009,   0.   ],\n",
       "       [ -6.999, -38.332, -29.037,   0.   ],\n",
       "       [ 33.391,  34.899,   7.706,   0.   ],\n",
       "       [-44.272, -27.499, -21.841,   0.   ]])"
      ]
     },
     "execution_count": 96,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "time_diffs = tdelay7np - tdelay7np[:, 3].reshape(-1, 1)\n",
    "time_diffs"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 99,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[  1.9716,  -7.3119,   0.2394,   0.    ],\n",
       "       [-17.7681,  -4.1322,  -6.6423,   0.    ],\n",
       "       [ -2.3811,   4.9161,  -8.5629,   0.    ],\n",
       "       [ -1.5321,  -2.3379,  -6.6027,   0.    ],\n",
       "       [ -2.0997, -11.4996,  -8.7111,   0.    ],\n",
       "       [ 10.0173,  10.4697,   2.3118,   0.    ],\n",
       "       [-13.2816,  -8.2497,  -6.5523,   0.    ]])"
      ]
     },
     "execution_count": 99,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "r_diffs=time_diffs*0.3\n",
    "r_diffs\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 100,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "3.0"
      ]
     },
     "execution_count": 100,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "10*0.3\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 81,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Estimated UEs positions: [(66.06016142563634, -30.40724945763635), (-86.46563410854549, -108.65985042745471), (-101.14118213236368, 277.63881606836355), (10.078553690181698, 134.14671867781826), (43.896926554363624, 27.338389157636332), (-13.295656137272818, 237.86809476727248), (-22.52346998400005, -110.34912462199985)]\n"
     ]
    }
   ],
   "source": [
    "import numpy as np\n",
    "\n",
    "def calculate_distance(time_ns):\n",
    "    \"\"\"Convert ToA to distance using the speed of light.\"\"\"\n",
    "    speed_of_light = 3e8  # meters per second\n",
    "    return time_ns * speed_of_light / 1e9\n",
    "\n",
    "def trilaterate(pos1, pos2, pos3, d1, d2, d3):\n",
    "    \"\"\"Calculate the intersection of three spheres given their centers and radii.\"\"\"\n",
    "    x1, y1 = pos1\n",
    "    x2, y2 = pos2\n",
    "    x3, y3 = pos3\n",
    "    \n",
    "    # Calculate differences between pairs of centers\n",
    "    A = x2 - x1\n",
    "    B = y2 - y1\n",
    "    C = x3 - x1\n",
    "    D = y3 - y1\n",
    "    \n",
    "    # Calculate squares of distances between centers\n",
    "    E = (d1**2 - d2**2 + A**2 + B**2)\n",
    "    F = (d1**2 - d3**2 + C**2 + D**2)\n",
    "    \n",
    "    # Solve for the unknown coordinates\n",
    "    det = A*D - B*C\n",
    "    if abs(det) < 1e-9:\n",
    "        raise ValueError(\"The three circles do not intersect at a unique point.\")\n",
    "    \n",
    "    px = (D*E - B*F) / det\n",
    "    py = (A*F - C*E) / det\n",
    "    \n",
    "    return px, py\n",
    "\n",
    "# Given data\n",
    "n = 7\n",
    "bs1 = (-5, -5)\n",
    "bs2 = (7, -4)\n",
    "\n",
    "\n",
    "tdelay7=pd.read_csv('tdelay7.csv')\n",
    "# Convert ToA to distances for each UE\n",
    "toas = np.array(tdelay7)\n",
    "distances = [[calculate_distance(toa) for toa in row] for row in toas]\n",
    "\n",
    "# Estimate the positions of UEs\n",
    "ues_positions = []\n",
    "for dists in distances:\n",
    "    ue_pos = trilaterate(bs1, bs2, (0, 0), dists[0], dists[1], dists[2])\n",
    "    ues_positions.append(ue_pos)\n",
    "\n",
    "# Estimate the positions of the remaining BSs\n",
    "# This part would involve using the estimated UE positions and their distances to the unknown BSs.\n",
    "# Since we don't have the positions of the last two BSs, we would need to use an optimization approach\n",
    "# or additional constraints to estimate their positions based on the UE positions and distances.\n",
    "\n",
    "print(\"Estimated UEs positions:\", ues_positions)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 83,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[[37.8897, 28.6062, 36.1575, 35.9181],\n",
       " [40.529399999999995, 54.1653, 51.65520000000001, 58.2975],\n",
       " [70.4247, 77.7219, 64.2429, 72.8058],\n",
       " [68.7135, 67.9077, 63.6429, 70.2456],\n",
       " [26.460899999999995, 17.061, 19.8495, 28.560600000000004],\n",
       " [73.4694, 73.9218, 65.7639, 63.4521],\n",
       " [49.7139, 54.7458, 56.4432, 62.99550000000001]]"
      ]
     },
     "execution_count": 83,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "distances"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 104,
   "metadata": {},
   "outputs": [],
   "source": [
    "a=(-5, -5) \n",
    "b=(7, -4)\n",
    "c=(-2, 3) \n",
    "d=(7, 9)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 127,
   "metadata": {},
   "outputs": [],
   "source": [
    "ue1=(-9, 7)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 128,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAARMAAAD8CAYAAABUzEBbAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAFyhJREFUeJzt3X+UVWW9x/H31xlgDBCEGhgZSzKTHwYILIg0F0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g48EXM5cUrcd9NR7l4TPdaZ2WOkD+m6U5i8ZWYV7l5rZhVAXXsv6A6HOe1eup8k0RfX5ErSA89J9VfgnOgmWD1JD5Qvz3NNOTOz3mbWt+k5MI1kf0+ZLCf9Exfo4E9dCmrP5GTM7ErgHuBDpC/d3+Dul7r7G2bWdOl+A80u3U+oO81sDOnDgR3AV/JbTue5e4OZ3QI8BZQAD0Q/tUi6QcBj6VvyUAr8xt2fzG9JnWdmDwGTgQ9GP4+5HfgB8IiZ3QT8H3BNu9vR5fQiEkJ3OMwRkQKgMBGRIBQmIhKEwkREglCYiEgQChMRCUJhIiJB/D+6SkGus//CjQAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "boxa = 10\n",
    "\n",
    "\n",
    "# 创建一个新的图形\n",
    "fig, ax = plt.subplots()\n",
    "# 设置坐标轴的范围\n",
    "ax.set_xlim(-boxa, boxa)\n",
    "ax.set_ylim(-boxa, boxa)\n",
    "# 设置坐标轴等比例显示\n",
    "ax.set_aspect('equal')\n",
    "\n",
    "\n",
    "plt.scatter(a[0],a[1]);\n",
    "plt.scatter(b[0],b[1]);\n",
    "plt.scatter(c[0],c[1]);\n",
    "plt.scatter(d[0],d[1]);\n",
    "\n",
    "plt.scatter(ue1[0],ue1[1]);\n",
    "ax.legend([\"1\",\"2\",\"3\",\"4\",\"ue\"])\n",
    "# 显示图形\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 129,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "9.0"
      ]
     },
     "execution_count": 129,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "30*0.3"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
